import request from '@/utils/request'
import extractVideoUrl from 'quill/themes/base'

//查询采购部门
export function getDepartment(query){
  return request({
    url:'/getDepsByPermissionCode',
    method:'get',
    params:query
  })
}
//查询采购主体
export function getOrg(){
  return request({
    url:'/getOrgs',
    method:'get',
  })
}
//获取库房数据
export function getSr(query){
  return request({
    url:'/getStoreRoomByOrgIdOrPermissions',
    method:'get',
    params:query
  })
}
//获取采购类型
export function getType(){
  return request({
    url:'/system/dict/data/type/purchasebill_type',
    method:'get',
  })
}
//查询供应商列表
export function getSupplier(){
  return request({
    url:'/getSuppliers',
    method:'get',
  })
}
//获取产品类型
export function getProductType(){
  return request({
    url:'/system/dict/data/type/product_type',
    method:'get',
  })
}
//获取产品
export function getProduct(query){
  return request({
    url:'/getProducts',
    method:'get',
    params:query
  })
}
//获取规格
export function getSpecs(query){
  return request({
    url:'/getSpecs',
    method:'get',
    params:query
  })
}
//添加采购订单
export function save(data){
  return request({
    url:'purchasebill/purchasebill/pc/save',
    method:'post',
    data:data
  })
}
//查询采购单明细列表
export function getPurchaseList(query){
  return request({
    url:'/purchasebill/purchasebillitem/list',
    method:'get',
    params:query
  })
}

//查询采购单明细
export function getPurchaseInfo(id){
  return request({
    url:'/purchasebill/purchasebill/' + id ,
    method:'get',
  })
}
//删除采购单明细
export function delPurchaseInfo(guid){
  return request({
    url:'/purchasebill/purchasebillitem/del/' + guid,
    method:'delete'
  })
}
//提交采购订单明细
export function addData(data){
  return request({
    url:'/purchasebill/purchasebill/pc/start',
    method:'post',
    data:data
  })
}
